<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <style>
         .grouptd {
             position: relative;
         }

         .group {
             display: inline-block;
             width: 100%;
         }

         .groupselect {
             position: absolute;
             top: 0;
             left: 0;
             width: 100%;
             height: 100%;
             border: 0;
         }
     </style>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                <!-- /section:settings.box -->
                <div class="row">
               <!--  教练排班列表页 -->
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                    	<button type="button"  class="btn btn-purple btn-sm pri" onclick='pri();'>
	                                    <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
	                                   		 打印全部
	                    </button>
	                    <button type="button"  class="btn btn-purple btn-sm pri" onclick='preview(1);'>
	                                    <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
	                                   		 打印当前页
	                    </button>
	                    <!--startprint1-->
						<div class="space-4"></div>
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!-- <th class="center"><input class="check-all" type="checkbox" value=""></th> -->
                                        <th class="center">教练姓名</th>
                                        <th class="center">教练手机号</th>
                                        <th class="center">使用车辆</th>
                                        <th class="center">车型</th>
                                        <th class="center">使用的场地</th>
                                        <th class="center">科目</th>
                                        <th class="center">练习类别</th>
                                    </tr>
                                    </thead>
                                       <tbody>
                                     <tr> 
                                           <td class="center">{$coachInfo['coach_name']}</td>
                                           <td class="center">{$coachInfo['phone']}</td>
                                           <td class="center">{$coachInfo['car_num']}</td>
                                           <td class="center">{$coachInfo['type']}</td>
                                           <td class="center">{$coachInfo['site']}</td>
                                           <td class="center">
                                            	<if condition="$coachInfo['course'] eq 1">科目二</if>
                                            	<if condition="$coachInfo['course'] eq 2">科目三</if>
                                           </td>
                                           <td class="center">
                                            	<if condition="$coachInfo['category'] eq 1">普通</if>
                                            	<if condition="$coachInfo['category'] eq 2">模拟</if>
                                           </td>
                                       </tr>
                                        <tr>
                                        		<td  colspan='7' class="center" style='color:green;font-size:16px;'>排班详情</td>
                                        </tr>
                                        <tr>
                                         <th class="center">序号</th>
                                        <th class="center" colspan="2">时间段</th>
                                        <th class="center">价格（单位：元）</th>
                                        <th class="center" colspan="2">状态</th>
                                        <th class="center">操作</th>
                                    </tr>
                                        <volist name="date" id="val" key='key'>
										<tr> 
                                            <td colspan='7' class="center">{$val['date']|date='Y-m-d',###}</td>
                                        </tr>
                                         <volist name="val.time" id="v" key='k'>
                                        <tr> 
                                        	<td class="center">{$k}</td>
                                            <td class="center" colspan="2">{$v['time']}</td>
                                            <td class="center">{$v['price']}</td>
                                            <td class="center" colspan="2">
											<if condition="$v['date_status'] eq 0">已取消排班</if>
                                            <if condition="$v['date_status'] eq 1">未预约</if>
                                            <if condition="$v['date_status'] eq 3">已预约（未支付）</if>
                                            <if condition="$v['date_status'] eq 4">已预约（已支付）</if>
                                            </td>
                                            <td class="center">
                                            	 <if condition="$v['date_status'] eq 1">
                                            	 	<a href="{:U('Appointment/cancel',array('date_id'=>$v['date_id']))}">取消排班</a>
                                            	 </if>
                                            	 <if condition="$v['date_status'] eq 0">
                                            	 	<a href="{:U('Appointment/uncancel',array('date_id'=>$v['date_id']))}">正常排班</a>
                                            	 </if>
                                            </td>
                                            </tr>
                                            </volist>
                                        </volist>                                  
                                    </tbody>
                                </table>
                                
                                
                                
                            <!-- <div class="cf">
                                <input id="submit" class="btn btn-info" type="button" value="删除">
                            </div> -->
                            {$page}
                            <!--endprint1-->
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>

<!-- inline scripts related to this page -->
<script type="text/javascript">
/*打印当前页 */
function preview(oper) {
	if (oper < 10) { 
	bdhtml = window.document.body.innerHTML;//获取当前页的html代码 
	sprnstr = "<!--startprint" + oper + "-->";//设置打印开始区域 
	eprnstr = "<!--endprint" + oper + "-->";//设置打印结束区域 
	prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html 
	prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html 
	window.document.body.innerHTML = prnhtml; 
	window.print(); 
	window.document.body.innerHTML = bdhtml; 
	} else { 
	window.print(); 
	}
}
/* 打印全部 */
function pri(){
	 var id ='';
	 if(id == ''){
		 id ='{:I('id')}';
	 }
	 var param = '/type/2';
if(id){
    param += '/id/'+id;
    location.href="__APP__/Admin/Appointment/detail"+param+".html";
}else{
	alert('参数错误！');
}

}
    
 


</script>
</body>
</html>
